//
//  UIBarButtonItem+category.m
//  pantaKills
//
//  Created by 湛凯杰 on 16/8/3.
//  Copyright © 2016年 湛凯杰. All rights reserved.
//

#import "UIBarButtonItem+category.h"

@implementation UIBarButtonItem (category)
-(instancetype)initRightBarButtonItemWithTarget:(id)target ImageOfNormal:(NSString*)normal ImageOfHighlighted:(NSString*)highlighted Action:(SEL)action{
    self=[super init];
    if (self) {
        UIButton * btn=[[UIButton alloc]initWithFrame:CGRectMake(0, 0, 30, 30)];
        [btn setImage:[UIImage imageNamed:normal] forState:UIControlStateNormal];
        [btn setImage:[UIImage imageNamed:highlighted] forState:UIControlStateHighlighted];
        [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];

        self=[[UIBarButtonItem alloc]initWithCustomView:btn];
    
    }return self;
}
@end
